package com.pearadmin.pro.modules.school.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.school.domain.PreCurriculumRelationship;
import com.pearadmin.pro.modules.school.domain.School;
import com.pearadmin.pro.modules.school.param.PreCurriculumRelationshipRequest;
import com.pearadmin.pro.modules.school.repository.PreCurriculumRelationshipRepository;
import com.pearadmin.pro.modules.school.service.PreCurriculumRelationshipService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * 前置课程代码关系Service业务层处理
 *
 * @author ChenJian
 * @date 2021-08-29
 */
@Service
public class PreCurriculumRelationshipServiceImpl extends ServiceImpl<PreCurriculumRelationshipRepository, PreCurriculumRelationship> implements PreCurriculumRelationshipService
{
    @Resource
    private PreCurriculumRelationshipRepository preCurriculumRelationshipRepository;

    /**
     * 查询前置课程代码关系
     * @param request
     * @return 前置课程代码关系 分页集合
     * */
    @Override
    public PageResponse<PreCurriculumRelationship> page(PreCurriculumRelationshipRequest request)
    {
        LambdaQueryWrapper<PreCurriculumRelationship> query = new LambdaQueryWrapper<PreCurriculumRelationship>();
        return Pageable.of(request,(()->  preCurriculumRelationshipRepository.selectList(query)));
    }

    /**
     * 查询前置课程代码关系
     *
     * @param id 前置课程代码关系ID
     * @return 前置课程代码关系
     */
    @Override
    public PreCurriculumRelationship selectPreCurriculumRelationshipById(Long id)
    {
        return preCurriculumRelationshipRepository.selectById(id);
    }

}
